bitkeeper revision 1.1236.1.9 (421da0c9oRchQk9qH4h9W-dsF3I1Jg)
authorarun.sharma@intel.com[kaf24] <arun.sharma@intel.com[kaf24]>
Thu, 24 Feb 2005 09:39:21 +0000 (09:39 +0000)
committerarun.sharma@intel.com[kaf24] <arun.sharma@intel.com[kaf24]>
Thu, 24 Feb 2005 09:39:21 +0000 (09:39 +0000)
[PATCH] gpa-page-zero.patch

GPFN = 0 is a valid page frame and we shouldn't inject #PG into guest.

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Index: trunk/xen/arch/x86/vmx.c
===================================================================

xen/arch/x86/vmx.c

index a14a145521d293706e24dc99b7c62a9f983eea33..4b47e52c2cd21165ebd14f7444efb89467fd2cef 100644 (file)
@@ -108,7 +108,7 @@ static void inline __update_guest_eip(unsigned long inst_len)
 static int vmx_do_page_fault(unsigned long va, struct xen_regs *regs) 
 {
     unsigned long eip;
-    unsigned long gpa;
+    unsigned long gpte, gpa;
     int result;
 
 #if VMX_DEBUG
@@ -130,9 +130,10 @@ static int vmx_do_page_fault(unsigned long va, struct xen_regs *regs)
         return 0;
     }
 
-    gpa = gva_to_gpa(va);
-    if (!gpa)
-        return 0;
+    gpte = gva_to_gpte(va);
+    if (!(gpte & _PAGE_PRESENT) )
+            return 0;
+    gpa = (gpte & PAGE_MASK) + (va & ~PAGE_MASK);
 
     if (mmio_space(gpa))
         handle_mmio(va, gpa);